<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
	  			xmlns:p="http://primefaces.prime.com.tr/ui"
				template="/WEB-INF/layouts/standard.xhtml">

<ui:define name="title">Polling</ui:define>

<ui:define name="notes">
	<h5>Comments:</h5>
	<p>
	  	Polling occurs every 3 seconds once started<br/>
	  	Review flow definition and view.xhtml in <span class="alt">src/main/webapp/WEB-INF/flows/poller</span>
	</p>
	<hr/>
</ui:define>

<ui:define name="content">
<h:form>
	<h:panelGroup id="content" layout="block" styleClass="notice">
		<h:outputLabel for="message" value="Current Time: " styleClass="large" />
		<hr/>
		<h:outputText id="message" value="${message}" styleClass="large alt" />
	</h:panelGroup>
	<br/>
	<p>
		<p:poll widgetVar="poller" interval="1" action="poll" update="content" autoStart="false" />
		<p:commandButton value="Start" action="start" update="content" onclick="poller.start()" />
		<p:commandButton value="Stop" action="stop" update="content" onclick="poller.stop()" />
		<p:commandButton value="Exit" action="exit" /><br/>
	<hr/>
<pre>
<span class="alt">&lt;p:poll widgetVar="poller" interval="1" action="poll" update="content" autoStart="false"/&gt;</span>
<span class="alt">&lt;p:commandButton value="Start" action="start" update="content" onclick="poller.start()"/&gt;</span>
<span class="alt">&lt;p:commandButton value="Stop" action="stop" update="content" onclick="poller.stop()"/&gt;</span>
</pre>		
	</p>
</h:form>

</ui:define>

</ui:composition>